home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 80 / CD Actual 80 Julio-Agosto 2003.iso / Linux / LinuxGazette / lg / issue72 / misc / nielsen / modules / Constants.pm next >
Encoding:
Perl POD Document  |  2002-08-14  |  1.8 KB  |  60 lines

  1. #!/usr/bin/perl
  2.  
  3. #              Create Functions for Perl/PostgreSQL version 1.0
  4.  
  5. #                       Copyright 2001, Mark Nielsen
  6. #                            All rights reserved.
  7. #    This Copyright notice was copied and modified from the Perl 
  8. #    Copyright notice. 
  9. #    This program is free software; you can redistribute it and/or modify
  10. #    it under the terms of either:
  11.  
  12. #        a) the GNU General Public License as published by the Free
  13. #        Software Foundation; either version 1, or (at your option) any
  14. #        later version, or
  15.  
  16. #        b) the "Artistic License" which comes with this Kit.
  17.  
  18. #    This program is distributed in the hope that it will be useful,
  19. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See either
  21. #    the GNU General Public License or the Artistic License for more details.
  22.  
  23. #    You should have received a copy of the Artistic License with this
  24. #    Kit, in the file named "Artistic".  If not, I'll be glad to provide one.
  25.  
  26. #    You should also have received a copy of the GNU General Public License
  27. #   along with this program in the file named "Copying". If not, write to the 
  28. #   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
  29. #    02111-1307, USA or visit their web page on the internet at
  30. #    http://www.gnu.org/copyleft/gpl.html.
  31.  
  32.  
  33. package SAMPLE::Constants;
  34.  
  35. use strict;
  36. use Apache;
  37. use DBI;
  38.  
  39. sub Get_Constants
  40. {
  41. my (@Temp) = @_;
  42. ### Have all the subroutines execute here and stuff the results
  43. ### into an array.
  44.  
  45. my $Global = {};
  46.  
  47. my $dbh;
  48. use DBI;
  49. use DBI;
  50.  
  51. $dbh ||= DBI->connect('dbi:Pg:dbname=sample',"","");
  52. $Global->{'dbh'} = $dbh;
  53. $Global->{'tempdir'} = '/tmp';
  54. $Global->{'web_root'} = '/usr/local/apache/htdocs';
  55.  
  56. return ($Global);
  57. }
  58.  
  59. 1;
  60.